<template>
	<h1>H4</h1>
	<input type="text" />
	<div class="btn">
		<button @click="toggle('h5')">切换5</button>
		<button @click="toggle('h1')">切换1</button>
	</div>
</template>

<script setup>
import { useRouter } from 'vue-router'
import { onMounted, onActivated } from 'vue'
const router = useRouter()
const toggle = (value) => {
	router.push(value)
}
onMounted(() => {
	console.log('🚀 ~ h4 执行 mounted')
})
onActivated(() => {
	console.log('🚀 ~ h4 执行 activated')
})
</script>

<style scoped>
.btn {
	padding-top: 20px;
}
button {
	margin-right: 10px;
}
</style>
